package NetEase;


import java.util.PriorityQueue;
import java.util.Scanner;

public class Main_0904_3 {
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        int n=cin.nextInt(),k=cin.nextInt(),x=cin.nextInt();
        int[] nums=new int[n];
        PriorityQueue<Integer> pq=new PriorityQueue<>((a,b)->{
            return b-a;
        });
        for (int i = 0; i < n; i++) {
            nums[i]=cin.nextInt();
            pq.offer(nums[i]);
        }
        if (n==1){
            int res=nums[0]-k*x;
            System.out.println(res);
            return;
        }
        //每次都对最大的那个数减去
        while (k>0){
            int cur=pq.poll();
            int nextMax=pq.peek();
            //一次最多可以减去多少个x
            int count=(cur-nextMax)%x==0?(cur-nextMax)/x:((cur-nextMax)/x+1);
            count=count==0?1:count;
            if (k-count<0){
                count=k;
            }
            pq.offer(cur-count*x);
            k-=count;
        }
        System.out.println(pq.peek());
    }
}
